package com.ruoyi.car.business.query;


import com.ruoyi.common.core.page.PageDomain;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Calendar;
import java.util.Date;

@Setter
@Getter
public class AppointmentQuery extends PageDomain {
    private String status;  //状态
    private String customerPhone; // 客户电话
    private String customerName;  // 客户名称


    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    public Date getEndTime() {
        if (endTime != null) {
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(endTime);
            calendar.add(Calendar.DAY_OF_WEEK,1);
            return calendar.getTime();
        }
        return null;
    }
}
